import {
    Action
} from 'redux';

import * as types from './../types/common';

const initState = {
    commonData:{},
    coinSetting:{},
    reportTypes:[]
}

export default (state=initState,action:Action) => {
    const {
        type,
        data
    } = action;

    switch (type) {
        case types.getCommonData:{
            state.commonData = data;
            return {
                ...state
            }
        }
        case types.getCoinSetting: {
            state.coinSetting = data;
            return {
                ...state
            }
        }
        case types.getReportTypes:{
            state.reportTypes=data;
            return {
                ...state
            }
        }
    }
    return state;
}